
<style>
	page{
		background: #fafafa;
	}
    .m-header-line {
        border: 1upx solid #e5e5e5;
    }
	
    .red {
        background: #ff413e;
    }

    .orange {
        background: #ff9b12;
    }

    .blue {
        background: #33b7e7;
    }

    .purple {
        background: #917be4;
    }

    .gray {
        background: #4b4b4b;
    }

    .g-content-box {
        width: 100%;
        overflow: hidden;
		padding-bottom: 100upx;
    }

    .m-log {
        width: 90%;
        margin: 0 auto;
        height: 100%;
    }

    .m-log-list {
        width: 100%;
		position: relative;
		padding-top: 20upx;
    }

    .m-log-line {
		position: absolute;
		top: 26upx;
        width: 6upx;
        height: 37upx;
        margin-right: 42upx;
    }

    .m-log-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
        width: 92%;
		margin-left: 40upx;
		padding-bottom: 20upx;
        border-bottom: 1px solid #e5e5e5;
    }

    .u-log-title {
        font-size: 32upx;
    }

    .u-log-date {
        font-size: 24upx;
        color: #aaa;
    }

    .m-log-info-r .money{
        font-size: 32upx;
        font-weight: bold;
		text-align: right;
    }
	
	.m-log-info-r .havemoney{
	    font-size: 24upx;
		text-align: right;
	}
	
    .f-log-plus {
        color: #ff4e00;
    }

    .f-log-minus {
        color: #4b4b4b;
		font-weight: bold;
    }

    .g-frame {
        width: 581upx;
        height: 729upx;
        background: #fff;
        border-radius: 20upx;
        position: fixed;
        top: 20%;
        overflow: hidden;
        left: 12%;
		z-index: 12;
    }

    .g-frame-mask {
        background: #000;
        opacity: .5;
        height: 100vh;
        width: 100%;
        position: fixed;
        top: 0upx;
		z-index: 11;
    }

    .m-frame-header {
        height: 110upx;
        width: 100%;
        background: #d71311;
        border-top-right-radius: 20upx;
        border-top-left-radius: 20upx;
    }

    .u-frame-title {
        width: 60%;
        height: 100%;
        text-align: right;
        color: #fff;
        line-height: 110upx;
        font-size: 32upx;
        float: left;
    }

    .u-frame-close {
        float: right;
        width: 42upx;
        height: 42upx;
        background-size: 100%;
        position: relative;
        top: 34upx;
        right: 32upx;
    }

    .m-frame-content {
        width: 100%;
        height: 100%;
    }

    .m-frame-box {
        width: 505upx;
        margin: 0 auto;
        padding-top: 48upx;
        height: 480upx;
        overflow-y: auto;
    }

    .m-frame-date-box {
        height: 107upx;
        width: 100%;
    }

    .m-frame-date-box-t {
        height: 25upx;
        margin-bottom: 16upx;
    }

    .u-frame-date-line {
        float: left;
        width: 5upx;
        height: 20upx;
        background: #d71311;
        margin-right: 12upx;
    }

    .u-frame-date-title {
        float: left;
        font-size: 26upx;
        position: relative;
        top: -6upx;
    }

    .m-frame-detail {
        overflow: hidden;
    }

    .m-date-l {
        height: 65upx;
        border: 2upx solid #e5e5e5;
        width: 235upx;
        border-radius: 8upx;
        display: inline-block;
    }

    .u-date {
        font-size: 28upx;
        line-height: 65upx;
        float: left;
        padding-left: 25upx;
    }

    .u-date-icon {
        width: 26upx;
        height: 27upx;
        float: right;
        position: relative;
        right: 13upx;
        top: 19upx;
    }

    .m-date-line {
        background: #e7e7e7;
        width: 8upx;
        height: 3upx;
        float: left;
        position: relative;
        top: 31upx;
        left: 12upx;
        margin-right: 12upx;
    }

    .m-date-r {
        float: right;
    }

    .m-frame-category .m-date-l {
        margin-bottom: 33upx;
        margin-right: 26upx;
    }

    .m-frame-category .m-date-l:nth-of-type(even) {
        margin-right: 0px;
    }

    .u-category {
        font-size: 28upx;
        color: #a5a5a5;
        text-align: center;
        line-height: 65upx;
    }

    .u-category-act {
        border: 2upx solid #d71311;
    }

    .u-category-act .u-category {
        color: #d71311 !important;
    }

    .m-frame-footer {
        height: 97upx;
        width: 100%;
        position: absolute;
        bottom: 0px;
        left: 0;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
		display: flex;
		align-items: center;
    }

    .m-frame-footer view {
		flex: 1;
        line-height: 97upx;
        text-align: center;
        font-size: 32upx;
    }

    .u-reset {
        color: #ff0000;
        background: #fff;
    }

    .u-confirm {
        background: #d71311;
        color: #fff;
        border-bottom-right-radius: 16upx;
    }

    .m-frame-date-box-bottom2 {
        display: flex;
        justify-content: space-between;
    }

    .f-border1px {
        position: relative;
    }
	.kd-turn{
		position: fixed;
		z-index: 10;
		bottom: 0;
		left: 0;
		width: 100%;
		color: #ffffff;
		background: #d71611;
		text-align: center;
		font-size: 32upx;
		padding: 25upx 0;
	}
	.ture-content{
		font-size: 32upx;
	}
	.ture-content .input{
		padding: 30upx 0;
	}
	.ture-content .input input{
		width: 99%;
		font-size: 40upx;
		text-align: center;
		border: 1px solid #828080;
		border-radius: 10upx;
		padding: 20upx 0;
	}
	.ture-content .tips .red{
		color: #D71511;
		margin-right: 10upx;
		background:none;
	}
	.ture-content .tips .icon{
		margin:0 10upx;
	}
	.ture-content .num{
		font-size: 38upx;
		color: #D71511;
	}
	.item-deital{
		position: fixed;
		left: 50%;
		top: 50%;
		margin-left: -320upx;
		background: #ffffff;
		border-radius: 3px;
		box-shadow: 0 0 5px rgba(0, 0, 0, .2);
		width: 600upx;
		padding: 20upx;
		z-index: 12;
		animation:show .3s;
		animation-fill-mode:forwards;
	}
	.item-deital .order-title{
		color: #333333;
		padding: 10upx 0;
		font-size: 32upx;
	}
	.item-deital .price{
		color: #D71511;
		font-size: 36upx;
		font-weight: bold;
	}
	.item-deital .fex{
		padding: 5upx 0;
		font-size: 32upx;
	}
	.deital-close{
		padding: 5px;
		border-radius: 100px;
		border: 3px solid #fff;
		position: absolute;
		bottom: -60px;
		left: 50%;
		transform: translateX(-50%);
	}
	@keyframes show  
    {  
        from {transform: translateY(-100%); }  
        to { transform: translateY(-50%);}  
    }  
	.allowance-foot{
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.allowance-foot .fex{
		flex: 1;
	}
</style>
<template>
    <view>
        <view class="g-content-box">
            <view class="m-log">
                
                <!-- 可用 -->
                <block v-if="type==1||type==2||type==4">
					<view class="m-log-list" v-for="(item, index) in data" :key="index">
						<view class="m-log-line" :class="[item.way_text=='收入' ? 'red' : 'gray']"></view>
						<view @tap="showDeital(item.id)" class="m-log-info">
							<view class="m-log-info-l">
								<view class="u-log-title">{{item.type_text}}({{item.is_accept_text}})</view>
								<view class="u-log-date">{{item.create_time}}</view>
							</view>
							<view class="m-log-info-r">
								<view class="money" :class="[item.way_text=='收入' ? 'f-log-plus' : 'f-log-minus']">{{item.way_text=='收入' ? '+'+item.money : '-'+item.money}}</view>
								<view class="havemoney">余额:{{item.havemoney}}</view>
							</view>
						</view>
					</view>
                </block>
                
                <!-- 备用 -->
                <block v-if="type==0">
					<view class="m-log-list" v-for="(item, i) in data" :key="i">
						<view class="m-log-line red"></view>
						<view class="m-log-info" @tap="showDeital(item.id)">
							<view class="m-log-info-l">
								<view class="u-log-title">{{item.status_text}}</view>
								<view class="u-log-date">通过日期: {{item.end_time_text}}</view>
							</view>
							<view class="m-log-info-r f-log-minus">{{item.frozen_money}}</view>
						</view>
					</view>
                </block>
				
				<!-- 津贴明细 -->
				<block v-if="type==3">
					<view class="m-log-list" v-for="(item, index) in data" :key="index">
						<view class="m-log-line" :class="[item.way_text=='收入' ? 'red' : 'gray']"></view>
						<view @tap="showDeital(item.id)" class="m-log-info">
							<view class="m-log-info-l">
								<view class="u-log-title">{{item.type_text}}({{item.is_accept_text}})</view>
								<view class="u-log-date">{{item.create_time}}</view>
							</view>
							<view class="m-log-info-r">
								<view class="money" :class="[item.way_text=='收入' ? 'f-log-plus' : 'f-log-minus']">{{item.way_text=='收入' ? '+'+item.money : '-'+item.money}}</view>
								<view class="havemoney">余额:{{item.havemoney}}</view>
							</view>
						</view>
					</view>
				</block>
				
                <view class="m-b-loading" v-if="showLoading">
                    <image src="../../static/images/loading2.gif" mode="widthFix"></image>
                    <text>加载中</text>
                </view>
				<view class="kd-turn" v-if="type == 2" @tap="turnIng('kdturn')">蝌蚪转粮仓</view>
				<view class="kd-turn allowance-foot" v-if="type == 3">
					<navigator open-type="navigate" :url="'/pages/user/hl_takecash?pageType=takeAllowance&state=1'" class="fex">津贴退取</navigator>
					<view class="fex" @tap="turnIng('allowanceturn')">津贴转典当粮仓</view>
				</view>
				
            </view>
        </view>
        <view class="g-frame-mask" v-if="showPopup||isDeital"></view>
        <view class="g-frame" v-if="showPopup">
            <view class="m-frame-header">
                <view class="u-frame-title">{{popheadText}}</view>
                <image class="u-frame-close" src="../../static/icons/ydt/close.png" mode="widthFix" @tap="togglePopup"></image>
            </view>

            <view class="m-frame-content">
                <view class="m-frame-box">
                    <view class="m-frame-date-box">
                        <!-- 可用粮仓 -->
                        <view v-if="type==1">
                            <view class="m-frame-detail m-frame-category">
                                <view class="m-frame-date-box-t">
                                    <view class="u-frame-date-line"></view>
                                    <view class="u-frame-date-title">类别</view>
                                </view>
                                <view class="m-frame-date-box-bottom">
                                    <view class="m-date-l f-border1px" v-for="(item,index) in moneytypeList" :key="index" :class="sendData.type == (index + 1) ? 'u-category-act' : ''"
                                        @tap="setParam('type',(index + 1))">
                                        <view class="u-category">{{item}}</view>
                                    </view>
                                </view>
                            </view>
                            <view class="m-frame-detail m-frame-category">
                                <view class="m-frame-date-box-t">
                                    <view class="u-frame-date-line"></view>
                                    <view class="u-frame-date-title">收入支出</view>
                                </view>
                                <view class="m-frame-date-box-bottom">
                                    <view class="m-date-l f-border1px " :class="sendData.way == '1' ? 'u-category-act' : ''"
                                        @tap="setParam('way','1')">
                                        <view class="u-category">收入</view>
                                    </view>
                                    <view class="m-date-l f-border1px" :class="sendData.way == '0' ? 'u-category-act' : ''"
                                        @tap="setParam('way','0')">
                                        <view class="u-category">支出</view>
                                    </view>
                                </view>
                            </view>
                            <view class="m-frame-detail m-frame-category">
                                <view class="m-frame-date-box-t">
                                    <view class="u-frame-date-line"></view>
                                    <view class="u-frame-date-title">类型排序</view>
                                </view>
                                <view class="m-frame-date-box-bottom">
                                    <view class="m-date-l f-border1px" :class="sendData.sort == 'money' ? 'u-category-act' : ''"
                                        @tap="setParam('sort','money')">
                                        <view class="u-category">按金额</view>
                                    </view>
                                    <view class="m-date-l f-border1px" :class="sendData.sort == 'create_time' ? 'u-category-act' : ''"
                                        @tap="setParam('sort','create_time')">
                                        <view class="u-category">按时间</view>
                                    </view>
                                </view>
                            </view>
                            <view class="m-frame-detail m-frame-category">
                                <view class="m-frame-date-box-t">
                                    <view class="u-frame-date-line"></view>
                                    <view class="u-frame-date-title">升/降序</view>
                                </view>
                                <view class="m-frame-date-box-bottom">
                                    <view class="m-date-l f-border1px" :class="sendData.order == 'asc' ? 'u-category-act' : ''"
                                        @tap="setParam('order','asc')">
                                        <view class="u-category">升序</view>
                                    </view>
                                    <view class="m-date-l f-border1px" :class="sendData.order == 'desc' ? 'u-category-act' : ''"
                                        @tap="setParam('order','desc')">
                                        <view class="u-category">降序</view>
                                    </view>
                                </view>
                            </view>
                        </view>
                        
                        <!-- 备用粮仓 -->
                        <view class="m-frame-detail m-frame-category" v-else-if="type==0">
                            <view class="m-frame-date-box-t">
                                <view class="u-frame-date-line"></view>
                                <view class="u-frame-date-title">状态</view>
                            </view>
                            <view class="m-frame-date-box-bottom">
                                <view class="m-date-l f-border1px" :class="sendData2.status == '1' ? 'u-category-act' : ''"
                                    @tap="setParam('status','1')">
                                    <view class="u-category">备用中</view>
                                </view>
                                <view class="m-date-l f-border1px" :class="sendData2.status == '2' ? 'u-category-act' : ''"
                                    @tap="setParam('status','2')">
                                    <view class="u-category">已通过</view>
                                </view>
                            </view>
                        </view>
						
						<!-- 蝌蚪明细 -->
						<view v-else-if="type==2&&!isKdTurnCont">
							<view class="m-frame-detail m-frame-category" >
								<view class="m-frame-date-box-t">
									<view class="u-frame-date-line"></view>
									<view class="u-frame-date-title">增加减少</view>
								</view>
								<view class="m-frame-date-box-bottom">
									<view class="m-date-l f-border1px" :class="sendData3.way == '1' ? 'u-category-act' : ''"
										@tap="setParam('way','1')">
										<view class="u-category">增加</view>
									</view>
									<view class="m-date-l f-border1px" :class="sendData3.way == '0' ? 'u-category-act' : ''"
										@tap="setParam('way','0')">
										<view class="u-category">减少</view>
									</view>
								</view>
							</view>
							<view class="m-frame-detail m-frame-category" >
								<view class="m-frame-date-box-t">
									<view class="u-frame-date-line"></view>
									<view class="u-frame-date-title">状态</view>
								</view>
								<view class="m-frame-date-box-bottom">
									<view class="m-date-l f-border1px" :class="sendData3.is_accept == '0' ? 'u-category-act' : ''"
										@tap="setParam('is_accept','0')">
										<view class="u-category">待审核</view>
									</view>
									<view class="m-date-l f-border1px" :class="sendData3.is_accept == '1' ? 'u-category-act' : ''"
										@tap="setParam('is_accept','1')">
										<view class="u-category">已审核</view>
									</view>
								</view>
							</view>
						</view>
						<!-- 津贴明细 -->
						<view v-else-if="type==3&&!isAllowanceCont">
							<view class="m-frame-detail m-frame-category" >
								<view class="m-frame-date-box-t">
									<view class="u-frame-date-line"></view>
									<view class="u-frame-date-title">增加减少</view>
								</view>
								<view class="m-frame-date-box-bottom">
									<view class="m-date-l f-border1px" :class="sendData5.way == '1' ? 'u-category-act' : ''"
										@tap="setParam('way','1')">
										<view class="u-category">增加</view>
									</view>
									<view class="m-date-l f-border1px" :class="sendData5.way == '0' ? 'u-category-act' : ''"
										@tap="setParam('way','0')">
										<view class="u-category">减少</view>
									</view>
								</view>
							</view>
						</view>	
						<view class="ture-content" v-if="isKdTurnCont">
							<view class="title">可退取蝌蚪余量：<text class="num">{{kedouTotal}}</text></view>
							<view class="input"><input type="number" v-model="kdamount" placeholder="请点击输入退取蝌蚪" /></view>
							<view class="tips"><text class="red">*</text>蝌蚪<text class="icon">:</text>米粮<text class="icon">=</text>1<text class="icon">:</text>1</view>
						</view>
						<view class="ture-content" v-if="isAllowanceCont">
							<view class="title">可转津贴：<text class="num">{{kedouTotal}}</text></view>
							<view class="input"><input type="number" v-model="allamount" placeholder="请点击输入转出津贴" /></view>
							<view class="tips"><text class="red">*</text>津贴<text class="icon">:</text>米粮<text class="icon">=</text>1<text class="icon">:</text>1</view>
						</view>
						
                    </view>

                    <view class="m-frame-footer">
                        <view class="u-reset" @tap="rest" v-if="!isKdTurnCont&&!isAllowanceCont">重置</view>
                        <view class="u-confirm" @tap="confirm('screenConfirm')" v-if="!isKdTurnCont&&!isAllowanceCont">确定</view>
						<view class="u-confirm" @tap="confirm('kdConfirm')" v-if="isKdTurnCont">确定</view>
						<view class="u-confirm" @tap="confirm('allowanceConfirm')" v-if="isAllowanceCont">确定</view>
                    </view>

                </view>
            </view>
        </view>
		
		
		<view class="item-deital" v-if="isDeital">
			<view class="order-title" v-if="deitalInfo.order_no">订单号：{{deitalInfo.order_no}}</view>
			<view class="order-deital" v-if="type != 0">
				<view class="fex"><text class="name">米  粮：</text><text class="text price">{{deitalInfo.way == 1 ? '+'+ deitalInfo.money : '-'+ deitalInfo.money}}</text></view>
				<view class="fex"><text class="name">账单类型：</text><text class="text">{{deitalInfo.type_text}}</text></view>
				<view class="fex"><text class="name">米粮类型：</text><text class="text">{{deitalInfo.account_type_text}}</text></view>
				<view class="fex"><text class="name">米粮状态：</text><text class="text">{{deitalInfo.way_text}}</text></view>
				<view class="fex"><text class="name">账单状态：</text><text class="text">{{deitalInfo.is_accept_text}}</text></view>
				<view class="fex"><text class="name">购买时间：</text><text class="text">{{deitalInfo.create_time}}</text></view>
			</view>
			
			<view class="order-deital" v-if="type == 0">
				<view class="fex"><text class="name">米  粮：</text><text class="text price">{{deitalInfo.money}}</text></view>
				<view class="fex"><text class="name">米粮类型：</text><text class="text">{{deitalInfo.account_type_text}}</text></view>
				<view class="fex"><text class="name">米粮状态：</text><text class="text">{{deitalInfo.status_text}}</text></view>
				<view class="fex"><text class="name">备用时间：</text><text class="text">{{deitalInfo.start_time_text}}</text></view>
				<view class="fex"><text class="name">通过时间：</text><text class="text">{{deitalInfo.end_time_text}}</text></view>
				<view class="fex"><text class="name">备注：</text><text class="text">{{deitalInfo.remark}}</text></view>
			</view>
			<view class="deital-close" @tap="closeDeital">
			    <close size="40" color="#ffffff"></close>
			</view>
		</view>
		
        <view class="m-no-data" v-if="showNodata">
            <image src="../../static/images/no_data.png" mode="widthFix"></image>
        </view>
    </view>
</template>

<script>
	import henglang from '@/common/common.js';
    export default {
        data() {
            return {
                showPopup: false,
                showLoading: false,
                showNodata: false,
                sendData: { // 可用粮仓
                    type: '',
                    way: '',
                    sort: '',
                    order: '',
                    page: 1,
                },
                sendData2: { // 备用
                    status: '',
                    page: 1,
                },
				sendData3: { // 蝌蚪
				    way: '',
					is_accept:'',
				    page: 1,
				},
				sendData4: { // 珠宝明细
				    way: '',
					is_accept:'',
				    page: 1,
					account_type: 4
				},
				sendData5: { // 津贴明细
				    account_type: 9,
				    page: 1,
					way: '',
				},
                data: [],
                type: 1, // 0 -> 备用粮仓  1-> 可用粮仓  2-> 蝌蚪明细 4-> 珠宝明细 3-> 津贴明细
				total_pages:1,
				moneytypeList:[],
				isKdTurnCont: false,
				kedouTotal:0,
				kdamount:'',
				tar:'',
				isDeital: false,
				deitalInfo:[],
				isAllowanceCont: false,
				allamount:'',
				popheadText:'列表筛选'
            };
        },
        methods: {
            togglePopup() {
                this.showPopup = !this.showPopup;
            },
			turnIng(type) {
				let that = this;
				uni.showLoading({
					title:'加载中...'
				})
				henglang.get('member/hasPaypwd',{},true,function(res){
					uni.hideLoading();
					if(res.data.data.has_paypwd){
						switch(type){
							case 'kdturn':
								that.kdamount = '';
								that.isKdTurnCont = true;
								that.popheadText = '蝌蚪退取';
								if(Number(that.kedouTotal) <= 0.00){
									henglang.showToast('暂无蝌蚪可转')
									return false
								}else{
									that.togglePopup();
								}
							break;
							case 'allowanceturn':
								that.allamount = '';
								that.isAllowanceCont = true;
								that.popheadText = '津贴转典当粮仓';
								if(Number(that.kedouTotal) <= 0.00){
									henglang.showToast('暂无津贴可转')
									return false
								}else{
									that.togglePopup();
								}
							break;	
						}
						
					}else{
						henglang.showToast('请先设置支付密码')
						setTimeout(() => {
							uni.navigateTo({
								url:'/pages/user/settings/set_checkpwd'
							})
						}, 3000)
					}
				});
			},
            setParam(key, val) {
                if (this.type == 1) { // 可用
                    this.sendData[key] = val;
                } else if (this.type == 0) { // 备用
                    this.sendData2[key] = val;
                } else if (this.type == 2) { // 蝌蚪
					this.sendData3[key] = val;
				}
            },
            rest() {
                this.sendData = {
                    type: '',
                    way: '',
                    sort: '',
                    order: '',
                    page: 1,
                }
                this.sendData2 = {
                    page: 1,
                    status: '',
                }
				this.sendData3 = {
				    page: 1,
				    way: '',
				    is_accept:'',
				}
            },
            confirm(e) {
				let that = this
				switch(e){
					case 'screenConfirm':
						if(that.type == 1){
							that.sendData.page = 1;
						}else if(that.type == 0){
							that.sendData2.page = 1;
						}else if(that.type == 2){
							that.sendData3.page = 1;
						}
						that.request();
						that.togglePopup();
					break;
					case 'kdConfirm':
						if(!that.kdamount ){
							henglang.showToast('请输入蝌蚪量')
						}else if(Number(that.kdamount) > Number(that.kedouTotal)){
							henglang.showToast('超出可退取蝌蚪余量，请重新输入')
						}else if(Number(that.kdamount) <= 0){
							henglang.showToast('输入的蝌蚪量错误，请重新输入')
						}else{
							uni.navigateTo({
								url:'/pages/user/hl_checkpwd?pageType=kdturn&kdamount=' + that.kdamount + '&price=' + that.kdamount
							})
						}
					break;
					case 'allowanceConfirm':
						if(!that.allamount){
							henglang.showToast('请输入转出津贴')
						}else{
							uni.navigateTo({
								url:'/pages/user/hl_checkpwd?pageType=allowanceturn&kdamount=' + that.allamount + '&price=' + that.allamount
							})
						}
					break;
				}
				
            },
			showDeital(id) {
				let that = this
				that.isDeital = true
				for (let i = 0; i < that.data.length; i++) {
					if(that.data[i].id == id){
						that.deitalInfo = that.data[i]
					}
				}
			},
			closeDeital() {
				this.isDeital = false;
			},
            request(type) {
				let that = this;
                if(!uni.getStorageSync('token')){
					that.showNodata = true;
					return false;
				}
				let url,current_page,sendData;
				if(that.type == 1){
					url = '/member/getMoneyLog';
					current_page = that.sendData.page;
					sendData = that.sendData;
				}else if(that.type == 0){
					url = '/member/getMoneyFrozen';
					current_page = that.sendData2.page;
					sendData = that.sendData2;
				}else if(that.type == 2){
					url = '/member/getKedou';
					current_page = that.sendData3.page;
					sendData = that.sendData3;
				}else if(that.type == 4){
					url = '/member/getKedou';
					current_page = that.sendData4.page;
					sendData = that.sendData4;
				}else if(that.type == 3){
					url = '/member/getKedou';
					current_page = that.sendData5.page;
					sendData = that.sendData5;
				}
				
				if(current_page <= that.total_pages){
					that.showLoading = true;
					henglang.get(url,sendData,true,function(res){
						that.showLoading = false;
						if (!res.data.data.length) { 
							that.data = ''
							that.showNodata = true;
							return false;
						}
						if (type == 'plus') {
							that.showNodata = false;
							that.data = that.data.concat(res.data.data);
						} else {
							that.showNodata = false;
							that.data = res.data.data;
							
						}
						
						that.total_pages = res.data.total_pages;
					});
				}
            },
			back() {
				if(this.type == 1&&this.tar == 1){
					uni.redirectTo({
						url: '/pages/user/user_index'
					})
				}else{
					uni.navigateBack()
				}
			}
        },
        onReady() {
            this.request();
        },
        onReachBottom() {
			if(this.type == 1){
				this.sendData.page = ++this.sendData.page;
			}else if(this.type == 0){
				this.sendData2.page = ++this.sendData2.page;
			}else if(this.type == 2){
				this.sendData3.page = ++this.sendData3.page;
			}else if(this.type == 4){
				this.sendData4.page = ++this.sendData4.page;
			}
			
            this.request('plus');
        },
        onNavigationBarButtonTap(e) {
            if (e.index == 0) {
                this.togglePopup();
				this.isDeital = false;
				this.isKdTurnCont = false
				this.isAllowanceCont = false
            }
        },
        onLoad({type,tar}) {
			let that = this
            that.type = type;
			this.tar = tar
			henglang.post('member/getMoneyLogType',{},true,function(res){
				for (let i in res.data.data) {
					that.moneytypeList.push(res.data.data[i]); 
				}
			})
			if(that.type == 2||that.type == 3){
				that.showLoading = true;
				henglang.post('transfer/availableKedou',{type:that.type},true,function(res){
					that.showLoading = false;
					that.kedouTotal = res.data.code == 0?res.data.data.kedou:0
				});
				
			}
			switch(Number(type)){
				case 0:
					uni.setNavigationBarTitle({
						title:'备用粮仓'
					})
				break;
				case 1:
					uni.setNavigationBarTitle({
						title:'可用粮仓'
					})
				break;
				case 2:
					uni.setNavigationBarTitle({
						title:'蝌蚪'
					})
				break;
				case 3:
					uni.setNavigationBarTitle({
						title:'津贴'
					})
				break;
			}
			
			
        },
		onBackPress(options) {  
			if (options.from === 'navigateBack') {  
				return false;  
			}  
			this.back();  
			return true;  
		}
    }
</script>
